package tornadofx.testapps

import tornadofx.*

class ReplaceTestApp: App(MyView1::class)

class MyView1 : View() {
    override val root = vbox {
        button("Go to MyView2") {
            action {
                replaceWith<MyView2>(ViewTransition.Slide(0.3.seconds, ViewTransition.Direction.LEFT))
            }
        }
        label("MyView1")
    }
}

class MyView2 : View() {
    override val root = vbox {
        button("Go to MyView1") {
            action {
                replaceWith<MyView1>(ViewTransition.Slide(0.3.seconds, ViewTransition.Direction.RIGHT))
            }
        }
        label ("MyView2")
    }
}
